package com.example.PDFdemo.pdftest;

import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import com.itextpdf.text.pdf.PdfWriter;

import java.io.FileOutputStream;
import java.io.IOException;

public class FormTest {

    private static final String OLD_File_PATH = "C:\\Users\\admin\\Desktop\\test1.pdf";
    private static final String NEW_File_PATH = "C:\\Users\\admin\\Desktop\\test2.pdf";

    public static void main(String[] args) throws IOException, DocumentException {
        PdfReader reader = new PdfReader(OLD_File_PATH);
        FileOutputStream outputStream = new FileOutputStream(NEW_File_PATH);
        PdfStamper stamper = new PdfStamper(reader, outputStream);
        PdfWriter writer = stamper.getWriter();
    }
}
